package ua.edu.sumdu.j2se.roman.lab1.view.console;


import ua.edu.sumdu.j2se.roman.lab1.domain.Task;
import ua.edu.sumdu.j2se.roman.lab1.util.Utils;
import ua.edu.sumdu.j2se.roman.lab1.view.ReminderView;

import java.util.Scanner;

/**
 * Author: Radko Roman.
 */

/**
 * Responsible for show user message about planed task.
 *
 */
public class ConsoleReminderView implements ReminderView {
    /**
     * String constants: close, postpone.
     *
     */
    public static final String CLOSE_COMMAND = "close";
    public static final String POSTPONE_COMMAND = "postpone";
    /**
     * Creates for read command from the console.
     *
     */
    private Scanner scanner;
    /**
     * Command from user.
     *
     */
    private String command;

    /**
     * Gets command from user.
     *
     * @return command
     */
    public String getCommandFromRemindView() {
        return command;
    }
    public ConsoleReminderView() {
        scanner = new Scanner(System.in);
    }

    /**
     * Shows remind about task with short sound.
     *
     * @param t task that be scheduled at some time
     */
    @Override
    public void show(Task t) {
        Utils.beep();
        System.out.println(t);
        System.out.println("To complete task enter: " + CLOSE_COMMAND);
        System.out.println("To postpone task enter: " + POSTPONE_COMMAND);
        command = scanner.next();
//        controller.performRemindAction(scanner.next(),t);
    }

}
